package com.waitingresult.entity;

import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.*;

import java.math.BigDecimal;

/**
 * @Author: WangShuai
 * @CreateTime: 2022-11-01  22:48
 * @Description:
 * @Version: 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
public class Student {
    private Long id;
    private String name;
    private String sex;
    private BigDecimal bd;

    public static boolean checkSexIsMan(Student student){
        return "男".equals(student.getSex());
    }
    public Student(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public static void main(String[] args) {
        Student student = new Student(1L,"","男",null);
        student.setName(ObjUtil.defaultIfBlank(student.getName(),"默认名称"));
       student.setBd(ObjectUtil.defaultIfNull(student.getBd(), BigDecimal.valueOf(0)));
        System.err.println(student);
    }
}
